From: Rui Matos Date: Tue, 21 May 2013 19:33:04 +0000 (+0200) Subject: userWidget: Fix leaking instances X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~4144 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=3754a76f104a09849cfce701e6ecb0339751c94b;p=gnome-shell.git userWidget: Fix leaking instances UserWidget instances should be destroyed when the actor is. That's what consumer code expects since the destroy() method is never called. https://bugzilla.gnome.org/show_bug.cgi?id=700807 --- diff --git a/js/ui/userWidget.js b/js/ui/userWidget.js index 06de0fc64..433b0bf60 100644 --- a/js/ui/userWidget.js +++ b/js/ui/userWidget.js @@ -16,6 +16,7 @@ const UserWidget = new Lang.Class({ this.actor = new St.BoxLayout({ style_class: 'user-widget', vertical: false }); + this.actor.connect('destroy', Lang.bind(this, this._onDestroy)); this._avatar = new UserMenu.UserAvatarWidget(user); this.actor.add(this._avatar.actor, @@ -36,7 +37,7 @@ const UserWidget = new Lang.Class({ this._updateUser(); }, - destroy: function() { + _onDestroy: function() { if (this._userLoadedId != 0) { this._user.disconnect(this._userLoadedId); this._userLoadedId = 0; @@ -46,8 +47,6 @@ const UserWidget = new Lang.Class({ this._user.disconnect(this._userChangedId); this._userChangedId = 0; } - - this.actor.destroy(); }, _updateUser: function() {